package ControlLayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class TestLaonCtr.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class TestLaonCtr
{
    /**
     * Default constructor for test class TestLaonCtr
     */
    public TestLaonCtr()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    @Test
    public void createLoan()
    {
        ControlLayer.DVDCtr dVDCtr1 = new ControlLayer.DVDCtr();
        ControlLayer.AddressCtr addressC1 = new ControlLayer.AddressCtr();
        ControlLayer.LoanCtr loanCtr1 = new ControlLayer.LoanCtr();
        dVDCtr1.createDVD(1, "Star Wars", "Lucas", "151179");
        dVDCtr1.createCopy(1, 1, "0405", "122");
        addressC1.createPerson(1, "Anders", "Pedersen", "9000", "Aalborg", "16357949");
        loanCtr1.createLoan(1, 1, 1, 1);
    }

    @Test
    public void returnLoan()
    {
        ControlLayer.LoanCtr loanCtr1 = new ControlLayer.LoanCtr();
        ControlLayer.DVDCtr dVDCtr1 = new ControlLayer.DVDCtr();
        ControlLayer.AddressCtr addressC1 = new ControlLayer.AddressCtr();
        addressC1.createPerson(1, "Anders", "Vesterbro", "9000", "Aalborg", "29117949");
        dVDCtr1.createDVD(1, "Star Wars", "lucas", "141179");
        dVDCtr1.createCopy(1, 1, "121211", "122");
        loanCtr1.createLoan(1, 1, 1, 1);
        loanCtr1.returnLoan(1);
    }
}


